    <style>
	.admin_window { background-color:#F0F0F0;clear:both;line-height:24px;margin:0;padding:0 5px; font-size:12px; }
    </style>
  
    <div id="container">
   		<div class="admin_window">{:L('blog_select_main_category')}{:L('blog_input_new_category_name')}</div>
        <div style="width:90%">
        	<dl class="mt10 cont_C">
            	<dt>{:L('blog_main_category')}</dt>
                <dd> <select id="category" name="category" style="width:100px;" class="mt10">
                <volist name="category" id="vo">
                		<option value="{$vo.id}">{$vo.name}</option>
                </volist>
                </select></dd>
            </dl>
            <dl class="mt10 cont_C">
            	<dt>{:L('blog_input_new_category')}</dt>
                <dd>
                <input type ="text" id="newCategory" name="newCategory" value="" class="mt10" style="width:100%; height:20px;"/></dd>
            </dl>
        </div>
			</div>

   <script>
   $(document).ready(function(){
       $('#cate_yes').click(function(){
       
           var category = $('#newCategory').val();
           
           var pid = $('#category').val();
           
           if (category != "") {
               $.post(URL + "&act=doAddCategory", {
                   pid: pid,
                   name: category
               }, function(txt){
                   if (-1 == txt) {
                       $.tbox.no('{:L('blog_add_category_field')}', '{:L('blog_opt')}');
                   }
                   else 
                       if (-2 == txt) {
                           $.tbox.yes('{:L('blog_new_category_field')}');
                       }
                       else 
                           if (-3 == txt) {
                               $.tbox.no('{:L('blog_add_category_field')}，{:L('blog_category_name_not_empty')}');
                           }
                           else {
                               select = $('#group');
                               select.before(select.children(':first').clone().val(txt).html(category));
                               $("#select option[value='" + txt + "']").attr('selected', true);
                               $.tbox.close();
                               return;
                           }
                   setTimeout('$.tbox.close()', 3000);
               })
               
           }
           else {
               alert('{:L('blog_please_input_new_category')}');
           }
           select = $('#select');
           select.children(':first').attr('selected', true);
           $.tbox.close();
       });
       
       $('#cate_no').click(function(){
           var title = $('#newCategory').val();
           title = $.trim(title);
           if (title != '') {
               if (false == window.confirm('{:L('blog_new_blog_category_not_empty')}，{:L('blog_delete_this_opt')}？')) {
                   return;
               }
               else {
                   $.tbox.close();
               }
           }
           else {
               $.tbox.close();
           }
       });
   });
</script> 